﻿@model TruckingApplication.Dal.EntityModels.RESOURCE

@{
    ViewBag.Title = "Edit";
}

<link href="@Url.Content("~/Content/jquery-ui.css")" rel="stylesheet" type="text/css" />
<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        //$('#startDate').datepicker();
    });
</script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <div id="lowerContainer">
	    <div id="lowerContainerInner">
		    <fieldset>
                <table id="tableMgmt" style="width: 100%;">
                    <tr>
                        <td>
                            @Html.HiddenFor(model => model.resourceID)
                            @Html.LabelFor(model => model.firstName)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.firstName)
                            @Html.ValidationMessageFor(model => model.firstName)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.lastName)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.lastName)
                            @Html.ValidationMessageFor(model => model.lastName)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.address)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.address)
                            @Html.ValidationMessageFor(model => model.address)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.city)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.city)
                            @Html.ValidationMessageFor(model => model.city)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.state)
                        </td>
                        <td>
                            @*@Html.DropDownList("States", "Select One")*@
                            @(Html.Kendo()
                                .DropDownList()
                                .Name("States")
                                .BindTo(ViewBag.States as SelectList)
                                .HtmlAttributes(new { style = "width:200px" })
                            )
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.zip)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.zip)
                            @Html.ValidationMessageFor(model => model.zip)  
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.startDate)
                        </td>
                        <td>
                            @(Html.Kendo().DatePickerFor(model => model.startDate).Name("startDate").HtmlAttributes(new { style = "width:200px" }))
                            @Html.ValidationMessageFor(model => model.startDate)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.ssNum)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.ssNum)
                            @Html.ValidationMessageFor(model => model.ssNum)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.taxID)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.taxID)
                            @Html.ValidationMessageFor(model => model.taxID)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.email)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.email)
                            @Html.ValidationMessageFor(model => model.email)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.phone)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.phone)
                            @Html.ValidationMessageFor(model => model.phone)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.commission)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.commission)
                            @Html.ValidationMessageFor(model => model.commission)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @*@Html.LabelFor(model => model.resourceTypeID, "RESOURCE_TYPE")*@
                            Resource Type
                        </td>
                        <td>
                            @*@Html.DropDownList("resourceTypeID", String.Empty)
                            @Html.ValidationMessageFor(model => model.resourceTypeID)*@
                            @(Html.Kendo()
                                .DropDownList()
                                .Name("resourceTypeID")
                                .BindTo(ViewBag.resourceTypeID as SelectList)
                                .HtmlAttributes(new { style = "width:200px" })
                            )
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.mcNumber)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.mcNumber)
                            @Html.ValidationMessageFor(model => model.mcNumber)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.factoringFee)
                        </td>
                        <td>
                            @Html.EditorFor(model => model.factoringFee)
                            @Html.ValidationMessageFor(model => model.factoringFee)
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <input type="submit" value="Save" class = "button default btnLarge" />
                            @Html.ActionLink("Cancel", "Dashboard", "Account", null, new { @class = "button cancel btnLarge" })
                        </td>
                    </tr>
                </table>
            </fieldset>
        </div>
    </div>
}